#include <xp/bas/string.h>
#include <xp/bas/stdlib.h>
#include <xp/bas/stdio.h>

int xp_main (int argc, xp_char_t* argv[])
{
	int n;
	xp_size_t len;

	if (argc != 4) {
		xp_fprintf (xp_stderr, 
			XP_TEXT("usage: %s string1 string2 len\n"), argv[0]);
		return -1;
	}

	len = xp_atoulong (argv[3]);

	n = xp_strcmpn (argv[1], argv[2], len);
	xp_printf (XP_TEXT("%s, %s, %llu => %d\n"), 
		argv[1], argv[2], (unsigned long long)len, n);

	n = xp_strcasecmpn (argv[1], argv[2], len);
	xp_printf (XP_TEXT("%s, %s, %llu => %d\n"),
		argv[1], argv[2], (unsigned long long)len, n);

	return 0;
}

